'''
此模块是用来生成测试报告的
'''
import sys
import os
basedir = os.path.dirname(os.path.dirname(__file__))
sys.path.append(basedir)
print(basedir)

import time
import unittest
from library.HTMLTestRunnerNew import HTMLTestRunner
from untile.handle_path import *
now = time.strftime('%Y-%m-%d-%H-%M-%S')
filename = report_path +'//'+str(now)+"_api_report.html"
def auto_run():
    discover = unittest.defaultTestLoader.discover(start_dir=testcase_path,
                                                   pattern='test_*.py')
    f = open(filename,"wb")
    runner = HTMLTestRunner(stream=f,
                            title='综合飞一次',
                            description='测试用例执行情况如下：',
                            tester='小郑')
    runner.run(discover)
    f.close()
if __name__ == '__main__':
    auto_run()







